
const sm = require('sm-crypto').sm2;

// 待加密的明文数据
const plaintext = '123456';



// 获取公钥和私钥
const publicKey = '04f097212e63d49c0189c9df6c78903a7ff353ee5eb1563ac410777be22a4c2193e81c5b16c3048b36598057cd07b352754e9f613e8d2cf3e891eba5751e0d6f30';

// 加密
const ciphertext = sm.doEncrypt(plaintext, publicKey);

console.log('加密后的密文：', ciphertext);
